#include <stdio.h>
#include <stdlib.h>

bool isperfect(long number)
{
    int sum = 0;

    for(int i = 1; i <= number/2; ++i)
    {
        if(number%i == 0)
        {
            sum+=i;
        }

    }


    if(sum==number)
        return true;
    else
        return false;
}

bool isprime(long number)
{
    long n;
    
	if( number == 2) return true;      
    if( number%2 == 0) return false; 
        
    n = 3;
    while (n*n <=number) 
    {
        if(number%n == 0) return false; 
        n += 2;
    }
    return true;
}
bool ispalindrome(long num){
	long n, rev = 0, dig;
	n = num;

	while(num>0)
	{
		dig = num % 10;
		rev = rev * 10 + dig;
		num = num / 10;
	}
	
	if (n == rev) return 1;
	else return 0;
}

main(int argc, char *argv[]) {

	if(argc<=1) {
		printf("You did not feed me arguments, I will die now :( ...\n");
		exit(1);
	}  //otherwise continue on our merry way....
	
	long arg1 = atol(argv[1]);  //argv[0] is the program name
                                //atoi = ascii to int
	printf("%ld,",arg1);
	(isperfect(arg1))?printf("%ld,",arg1):printf("noperfect,");
	(isprime(arg1))?printf("%ld,",arg1):printf("noprime,");
	(ispalindrome(arg1))?printf("%ld",arg1):printf("nopalindrome");
	printf("\n");
}
